package cn.doitedu.day07

object MyPreDef2 {

  implicit def manToOrderedMan(man: Man): Ordered[Man] = {

    new Ordered[Man] {
      override def compare(that: Man): Int = {
        java.lang.Double.compare(man.fv, that.fv)
      }
    }

  }


  //隐式参数
  implicit object OrderingGirl extends Ordering[Girl] {
    override def compare(x: Girl, y: Girl): Int = {
      java.lang.Double.compare(x.fv, y.fv)
    }
  }

}
